<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Logic\OrderLogic;

class FinancialController extends BaseController
{
    /**
     * 财务公司总览
     * @param Request $request
     */
    public function index(Request $request){
    	
    	
    	return $this->view(null);
    }
	
    /**
     * 财务公司明细
     * @param Request $request
     */
    public function detail(Request $request){
    	
    	
    	return $this->view(null);
    }    
    
    /**
     * 订单查看
     * @param Request $request
     * @return View
     */
    public function order(Request $request){
    	
    	
    	return $this->view(null);
    }
    
    /**
     * 订单确认
     * @return View
     */
    public function sure(Request $request){    	

    	
    	
    	return $this->view(null);
    }
    
    
    /**
     * 生成订单
     * @return View
     */
    public function create(Request $request){    	
    	if($request->isMethod('patch')){ 
    		$orderModel = new OrderLogic();
    		$orderInfo = $orderModel->orderStep($request);
    		if ($orderInfo['order_code']) {
    		    flash('生成订单成功')->success()->important();
    			return redirect()->route('financial.order');
    		}
    	}
    	    	
    	return $this->view(null);
    	
    }
}
